package com.heima.user.controller.v1;

import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.user.dtos.AuthDto;
import com.heima.model.user.dtos.ApPageReqDto;
import com.heima.user.service.ApUserAuthService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Slf4j
@RestController
@RequestMapping("/api/v1/auth")
@Api(value = "app端用户审核", tags = "app端用户审核")
public class ApUserAuthController {

    @Autowired
    private ApUserAuthService apUserAuthService;

    @ApiOperation("用户审核列表查询")
    @PostMapping("/list")
    public ResponseResult authList(@RequestBody ApPageReqDto dto) {
        log.info("用户审核列表查询: {}", dto);
        return apUserAuthService.authList(dto);
    }

    @PostMapping("/authPass")
    public ResponseResult authPass(@RequestBody AuthDto dto) {
        log.info("通过审核: {}", dto);
        return apUserAuthService.authPass(dto);
    }
    @PostMapping("/authFail")
    public ResponseResult authFail(@RequestBody AuthDto dto) {
        log.info("驳回审核: {}", dto);
        return apUserAuthService.authFail(dto);
    }
}